package com.blue.code.util;

import java.sql.Types;

public class SqlTypeConvertor
{
	private SqlTypeConvertor()
	{
	}
	
	public static String sqlTypeToJava(int type)
	{
		String name = null;
		if (type == Types.BIGINT)
			name = "Long";
		else if (type == Types.INTEGER || type == Types.SMALLINT || type == Types.TINYINT)
			name = "Integer";
		else if (type == Types.FLOAT)
			name = "Float";
		else if (type == Types.DOUBLE || type == Types.REAL || type ==Types.NUMERIC)
			name = "Double";
		else if (type == Types.DATE || type == Types.TIME || type == Types.TIMESTAMP)
			name = "Date";
		else if (type == Types.VARCHAR || type == Types.CHAR || type == Types.NVARCHAR || type == Types.NCHAR)
			name = "String";
		
		return name;
	}
	
}
